home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / GET_DIR.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  1KB  |  43 lines

  1. ;    DESC:    gets the current directory path string in the form   V1.00
  2. ;        dir1\dir2\dir3...
  3. ;    IN:    *{DRIVE} drive number of the drive to operate on where
  4. ;         0 is the default, 1 is A, etc.
  5. ;        *{SEG_VAL} segment and
  6. ;        *{OFFSET} offset of 64 byte user are where resultant string
  7. ;         will be placed ending with a byte containing 0
  8. ;    SAMPLE:    Callm    GET_DIR,<DRIVE,SEG_VAL,OFFSET>,
  9. ;    ###################################################################
  10.  
  11.     Extrn    PUSHALL:Near
  12.     Extrn    POPALL:Near
  13.     Extrn    ERRORMSG:Near
  14.  
  15. GET_DIRC    Segment
  16.     Assume    CS:GET_DIRC
  17.     Public    GET_DIR
  18.  
  19.                         ;notice.
  20.     DB    'GET_DIR  - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  21.  
  22. GET_DIR    Proc    Near                ;gets the current directory.
  23.  
  24.     Call    PUSHALL
  25.  
  26.     Pop    SI                ;offset of user area.
  27.     Pop    DS                ;segment of user area.
  28.     Pop    DX                ;drive number.
  29.  
  30.     Mov    AH,47H                ;gets the current directory.
  31.     Int    21H
  32.     Jc    ERROR                ;if error, report it.
  33.  
  34.     Call    POPALL
  35.     Ret
  36.  
  37. ERROR:    Push    AX                ;report error and abort.
  38.     Call    ERRORMSG
  39.  
  40. GET_DIR    Endp
  41. GET_DIRC    Ends
  42.     End
  43.